<!--#layout("/common/layout.html",{"jsBase":"/js/meet/meetRecord/"}){ -->
<form class="layui-form layui-form-pane" id="assignForm"  lay-filter="assignForm">
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" >服务老师</label>
                <div class="layui-input-inline">
                    <layui:simpleDataSelect name="toCustomerid"  data="${teacherList}"
                                            attrId="customerId" attrName="customerName" laySearch="true" layFilter="colFilter" id="toCustomerid" />
                </div>
                <input type="hidden" name="meetId" value="${meetId}"/>
                <input type="hidden" name="meetName" id="meetName"/>

            </div>

        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" >时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="contactTime" id="contactTime" class="layui-input" placeholder="例如:2020-10-10 10:10"/>
                </div>
            </div>

        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">内容</label>
                <div class="layui-input-block" style="width:512px">
                    <textarea name="content"  id="content" placeholder="请输入" class="layui-textarea" ></textarea>
                </div>
            </div>
        </div>

    </div>
    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script language="JavaScript">

    layui.extend({
        loading: '../../../plugins/layui_extends/loading/loading',
    }).define([ 'form', 'laydate', 'table','loading','meetRecordApi'], function(exports) {
        var form = layui.form;
        var laydate = layui.laydate;
        var meetRecordApi = layui.meetRecordApi;
        $("#addButton").click(function(){
            // $("#addButton").hide();
            // $("#addButton-loading").show();
            // $("#addButton-loading").loading();
            if($("#toCustomerid").val()==""){
                Common.info("请选择服务老师");
                return;
            }
            form.on('submit(form)', function(){
                meetRecordApi.assign($('#assignForm'),function(){
                    parent.window.dataReload();
                    Common.info("保存成功");
                    Lib.closeFrame();
                });
            });
        });

        $("#addButton-cancel").click(function(){
            Lib.closeFrame();
        });

        form.on('select(colFilter)', function(){
            $("#meetName").val($("#toCustomerid").find("option:selected").text());
        });

        laydate.render({
            elem: '#contactTime'
            ,type: 'datetime'
            ,range: false
            ,format: 'yyyy-MM-dd HH:mm'
        });

    });

</script>
